package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 设备维护记录表
 * @TableName device_maintenance_record
 */
@TableName(value ="device_maintenance_record")
@Data
public class DeviceMaintenanceRecord implements Serializable {
    /**
     * 记录ID
     */
    @TableId(type = IdType.AUTO)
    private Long recordId;

    /**
     * 计划ID
     */
    private Long planId;

    /**
     * 设备ID
     */
    private Long deviceId;

    /**
     * 维护日期
     */
    private Date maintenanceDate;

    /**
     * 维护人员
     */
    private String maintenancePerson;

    /**
     * 维护内容
     */
    private String maintenanceContent;

    /**
     * 维护结果：1-正常，2-异常
     */
    private Integer maintenanceResult;

    /**
     * 费用
     */
    private BigDecimal cost;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DeviceMaintenanceRecord other = (DeviceMaintenanceRecord) that;
        return (this.getRecordId() == null ? other.getRecordId() == null : this.getRecordId().equals(other.getRecordId()))
            && (this.getPlanId() == null ? other.getPlanId() == null : this.getPlanId().equals(other.getPlanId()))
            && (this.getDeviceId() == null ? other.getDeviceId() == null : this.getDeviceId().equals(other.getDeviceId()))
            && (this.getMaintenanceDate() == null ? other.getMaintenanceDate() == null : this.getMaintenanceDate().equals(other.getMaintenanceDate()))
            && (this.getMaintenancePerson() == null ? other.getMaintenancePerson() == null : this.getMaintenancePerson().equals(other.getMaintenancePerson()))
            && (this.getMaintenanceContent() == null ? other.getMaintenanceContent() == null : this.getMaintenanceContent().equals(other.getMaintenanceContent()))
            && (this.getMaintenanceResult() == null ? other.getMaintenanceResult() == null : this.getMaintenanceResult().equals(other.getMaintenanceResult()))
            && (this.getCost() == null ? other.getCost() == null : this.getCost().equals(other.getCost()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRecordId() == null) ? 0 : getRecordId().hashCode());
        result = prime * result + ((getPlanId() == null) ? 0 : getPlanId().hashCode());
        result = prime * result + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
        result = prime * result + ((getMaintenanceDate() == null) ? 0 : getMaintenanceDate().hashCode());
        result = prime * result + ((getMaintenancePerson() == null) ? 0 : getMaintenancePerson().hashCode());
        result = prime * result + ((getMaintenanceContent() == null) ? 0 : getMaintenanceContent().hashCode());
        result = prime * result + ((getMaintenanceResult() == null) ? 0 : getMaintenanceResult().hashCode());
        result = prime * result + ((getCost() == null) ? 0 : getCost().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", recordId=").append(recordId);
        sb.append(", planId=").append(planId);
        sb.append(", deviceId=").append(deviceId);
        sb.append(", maintenanceDate=").append(maintenanceDate);
        sb.append(", maintenancePerson=").append(maintenancePerson);
        sb.append(", maintenanceContent=").append(maintenanceContent);
        sb.append(", maintenanceResult=").append(maintenanceResult);
        sb.append(", cost=").append(cost);
        sb.append(", remark=").append(remark);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}